package com.newtouch.bxzs.database.synchronize.quartz;

import com.newtouch.bxzs.database.synchronize.quartz.job.*;
import org.quartz.JobBuilder;
import org.quartz.JobDetail;
import org.springframework.stereotype.Component;

/**
 * SchedulerDemo:
 *
 * <p>
 * <b>History:</b>
 * <table border="1">
 * <tr>
 * <th>Date</th>
 * <th>Operator</th>
 * <th>Memo</th>
 * </tr>
 * <tr>
 * <td>2020/12/25 16:52</td>
 * <td>Amour</td>
 * <td>Create</td>
 * </tr>
 * </table>
 *
 * @author yuanjie
 * @version 1.0.0
 * @since 1.0.0
 */
@Component
public class QuartzJobDetail {

    /**同步机构*/
    public JobDetail synchronizeOrganJob(){
        return JobBuilder.newJob(SynchronizeOrganJob.class)
                .withIdentity("synchronizeOrganJob")
                .build();
    }

    /**同步用户*/
    public JobDetail synchronizeUserJob(){
        return JobBuilder.newJob(SynchronizeUserJob.class)
                .withIdentity("synchronizeUserJob")
                .build();
    }

    /**同步客户*/
    public JobDetail synchronizeCustomerJob(){
        return JobBuilder.newJob(SynchronizeCustomerJob.class)
                .withIdentity("synchronizeCustomerJob")
                .build();
    }
    /**同步业绩*/
    public JobDetail synchronizeAchievementJob(){
        return JobBuilder.newJob(SynchronizeAchevementJob.class)
                .withIdentity("synchronizeAchievementJob")
                .build();
    }
    /**同步收入*/
    public JobDetail synchronizeIncomeJob(){
        return JobBuilder.newJob(SynchronizeIncomeJob.class)
                .withIdentity("synchronizeIncomeJob")
                .build();
    }
    /**同步产品*/
    public JobDetail synchronizeProductJob(){
        return JobBuilder.newJob(SynchronizeProductJob.class)
                .withIdentity("synchronizeProductJob")
                .build();
    }

    /**定时修改本地数据*/
    public JobDetail updateStatusJob(){
        return JobBuilder.newJob(BatchUpdateStatusJob.class)
                .withIdentity("updateStatusJob")
                .build();
    }

    /**提醒升级*/
    public JobDetail remainToUpgradeJob(){
        return JobBuilder.newJob(RemainToUpgradeJob.class)
                .withIdentity("remainToUpgradeJob")
                .build();
    }
}
